@import 'month';
@import '../../../styles/var';

@date-picket: ~'@{prefix}-date-picker';

.@{date-picket} {
  vertical-align: top;
  display: inline-block;
  font-size: 14px;
  line-height: 20px;
  font-family: @font-family;
  color: @font-color;

  &:focus,
  &.is-open {
    .@{date-picket}-inner {
      border: 1px solid @primary-color;
      box-shadow: @focus-shadow-primary-light;
    }
  }
}

.@{date-picket}-toggle {
  box-sizing: border-box;
  width: 200px;
}

.@{date-picket}-inner {
  position: relative;
  display: block;
  box-sizing: border-box;
  border: 1px solid @border-color;
  height: 30px;
  transition: border @normal-motion linear, box-shadow @normal-motion linear;

  &:hover:not(.is-disabled) {
    border: 1px solid @primary-color;
  }

  &.is-disabled {
    opacity: 0.5;
  }
}

.@{date-picket}-input {
  font-size: 14px;
  line-height: 20px;
  box-sizing: border-box;
  border: none;
  width: 100%;
  height: 100%;
  padding: 4px 28px 4px 10px;
  outline: none;
  cursor: default;
  color: @font-color;

  &[disabled] {
    background-color: @component-darker-background;
  }
}

.@{date-picket}-suffix {
  float: right;
  position: absolute;
  top: 0;
  right: 0;
  width: 24px;
  height: 24px;
  margin: 2px;
  font-size: 24px;
  color: @font-light-color;
  pointer-events: none;
}

.@{date-picket}-months {
  white-space: nowrap;
  padding: 1px;
}

.@{date-picket}-tooltip {
  position: absolute;
  color: @font-lighter-color;
  border: 1px solid @border-color;
  padding: 5px 10px;
  pointer-events: none;
  background-color: @component-background;
  line-height: 20px;
  text-align: center;
  box-shadow: @dropdown-shadow-light;
  white-space: nowrap;
  margin-top: 10px;
  margin-left: 15px;
  transform: translate(-50%, 0);

  &:before,
  &:after {
    width: 0;
    height: 0;
    border-style: solid;
    content: '';
    display: block;
    position: absolute;
    left: 50%;
    transform: translate(-50%, 0);
  }

  &:before {
    top: -7px;
    border-width: 0 7px 7px 7px;
    border-color: transparent transparent @border-color transparent;
  }

  &:after {
    top: -5.5px;
    border-width: 0 6px 6px 6px;
    border-color: transparent transparent @component-background transparent;
  }
}
